<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jstl/core"
                xmlns:sf="http://www.springframework.org/tags/faces"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:spring="http://www.springframework.org/tags"
                template="../../../layout/Template.xhtml">

    <ui:define name="menu">
        <ui:include src="${user.menu}"/>
    </ui:define>

    <ui:define name="title">
        <h:outputText value="#{resourceBundle.createProjectWelcome}"/>
    </ui:define>

    <ui:define name="content">
        <ui:fragment id="createProjectFragment">
            <rich:panel id="createProjectPanel" header="#{resourceBundle.createProjectWelcome}">
                <h:form id="createProjectForm">
                    <h:panelGrid id="createProjectGrid" columns="3">
                        <h:outputText
                                value="#{resourceBundle.createProjectFormSubject} : "/>
                        <h:inputText
                                value="#{viewScope.createdProject.subject}"
                                id="subject" required="true"
                                requiredMessage="#{resourceBundle.createProjectRequiredMessageSubject}"/>
                        <h:message for="subject" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createProjectFormContain} : "/>
                        <h:inputTextarea
                                value="#{viewScope.createdProject.contain}"
                                id="contain" required="true"
                                requiredMessage="#{resourceBundle.createProjectRequiredMessageContain}"/>
                        <h:message for="contain" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createProjectFormLinkSupport} : "/>
                        <h:inputText
                                value="#{viewScope.createdProject.linkSupport}"
                                id="linkSupport" required="true"
                                requiredMessage="#{resourceBundle.createProjectRequiredMessageLinkSupport}"/>
                        <h:message for="linkSupport" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createProjectFormWeight} : "/>
                        <h:inputText
                                value="#{viewScope.createdProject.weight}"
                                id="weight" required="true"
                                requiredMessage="#{resourceBundle.createProjectRequiredMessageWeight}"/>
                        <h:message for="weight" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createProjectFormDeadLineHour} : "/>
                        <h:inputText
                                value="#{viewScope.createdProject.deadLineHour}"
                                id="deadLineHour" required="true"
                                requiredMessage="#{resourceBundle.createProjectRequiredMessageDeadLineHour}"
                                converterMessage="#{resourceBundle.createProjectConverterMessageDeadLineHour}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="deadLineHour" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createProjectFormDeadLineDate} : "/>
                        <h:inputText
                                value="#{viewScope.createdProject.deadLineDate}"
                                id="deadLineDate" required="true"
                                requiredMessage="#{resourceBundle.createProjectRequiredMessageDeadLineDate}"
                                converterMessage="#{resourceBundle.createProjectConverterMessageDeadLineDate}">
                            <f:convertDateTime pattern="dd/MM/yy" type="date"/>
                        </h:inputText>
                        <h:message for="deadLineDate" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createProjectFormPresentationHour} : "/>
                        <h:inputText
                                value="#{viewScope.createdProject.presentationHour}"
                                id="presentationHour"
                                converterMessage="#{resourceBundle.createProjectConverterMessagePresentationHour}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="presentationHour" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createProjectFormPresentationDate} : "/>
                        <h:inputText
                                value="#{viewScope.createdProject.presentationDate}"
                                id="presentationDate"
                                converterMessage="#{resourceBundle.createProjectConverterMessagePresentationDate}">
                            <f:convertDateTime pattern="dd/MM/yy" type="date"/>
                        </h:inputText>
                        <h:message for="presentationDate" style="color:red"/>
                    </h:panelGrid>

                    <h:messages globalOnly="true"/>

                    <a4j:commandButton type="submit" value="#{bundle.addButton}" action="add"/>
                    <a4j:commandButton value="#{bundle.cancelButton}" action="cancel" immediate="true"/>
                </h:form>
            </rich:panel>
        </ui:fragment>
    </ui:define>

</ui:composition>